<?php if (!defined('THINK_PATH')) exit();?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>欢迎登录后台管理系统</title>
<link href="<?php echo C('HOME_CSS');?>style.css" rel="stylesheet" type="text/css" />

<script language="JavaScript" src="<?php echo C('HOME_JS');?>jquery-2.0.3.min.js"></script>
<script src="<?php echo C('LAYER');?>layer.js"></script>
<script src="<?php echo C('HOME_JS');?>cloud.js" type="text/javascript"></script>
<script language="javascript">
	$(function(){
    $('.loginbox').css({'position':'absolute','left':($(window).width()-692)/2});
	$(window).resize(function(){  
    $('.loginbox').css({'position':'absolute','left':($(window).width()-692)/2});
    })  
});  
</script> 
</head>
<body style="background-color:#1c77ac; background-image:url(<?php echo C('HOME_IMAGE');?>light.png); background-repeat:no-repeat; background-position:center top; overflow:hidden;">
    <div id="mainBody">
      <div id="cloud1" class="cloud"></div>
      <div id="cloud2" class="cloud"></div>
    </div>  
    <div class="loginbody">
	    <!-- <span class="systemlogo"></span>  -->
	    <div class="loginbox" style="margin-top:140px;">
		    <ul>
		    	<li><input name="" type="text" class="loginuser" placeholder="用户名" value="" onclick="JavaScript:this.value=''"/></li>
		    	<li><input name="" type="password" class="loginpwd" placeholder="密码" value="" onclick="JavaScript:this.value=''"/></li>
		    	<li>
			    	<input name="" type="button" class="loginbtn" value="登录"  onclick=""  />
			    	<!-- 
			    	<label>
			    		<input name="" type="checkbox" value="" checked="checked" />记住密码
			    	</label>
			    	<label><a href="#">忘记密码？</a></label>
			    	 -->
		    	</li>
		    </ul>
	    </div>
    </div>
    <script>
    	$('.loginbtn').click(function(){
    		var loginuser=$('.loginuser').val();
    		var loginpwd =$('.loginpwd').val();
    		if(!loginuser){
    			layer.msg('请填写用户名');
    			return false;
    		}
    		if(!loginpwd){
    			layer.msg('请填写密码');
    			return false;
    		}
    		var data = {user:loginuser,pwd:loginpwd}
    		var url = "<?php echo U('Login/login');?>";
    		$.post(url,data,function(res){
    			if(res.code==1){
    				layer.msg('登录成功',{time:1000},function(){
    					window.location.href="<?php echo U('Index/index');?>";
    				})
    			}else{
    				layer.msg(res.msg);
    			}
    		})
    	})
    </script>
</body>
</html>